package com.example.demo.Controller;

import com.example.demo.Service.DeviceService;
import com.example.demo.Service.HealthyService;
import com.example.demo.entity.Device;
import com.example.demo.entity.Healthy;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RequestMapping("/Space")
@RestController
public class DeviceController {
    @Autowired
    DeviceService deviceService;

    @GetMapping("/getdevice")
    public List<Device> getd(){
        return deviceService.list();
    }
    @RequestMapping("/add")
    public void add(@RequestBody Device device){
        deviceService.save(device);
    }
}
